﻿
using CommunityToolkit.Mvvm.Input;
using GalFrameWork.Services;

namespace GalFrameWork.ViewModel;
public class SceneEditPageViewModel {
    private ISceneStorage _sceneStorage;

    public SceneEditPageViewModel(ISceneStorage sceneStorage) {
        _sceneStorage = sceneStorage;
    }
    //前台图片
    private ImageSource _imageSource;
    //返回一个图片
    public ImageSource ImageSource
    {
        get => _imageSource;
        //set => SetProperty(ref _imageSource, value);
    }

    private RelayCommand _addImageCommand;

    public RelayCommand AddImageCommand => _addImageCommand ??= new RelayCommand( () => {
        //将后台传回的图片赋值给前台的图片
        _imageSource = _sceneStorage.addImageToScene(null, null);
    });
}

